package dao.impl;

import dao.BlackListDao;
import domain.BlackList;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import util.JDBCUtils;

import java.util.List;

public class BlackListDaoImpl implements BlackListDao {
    private JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());
    @Override
    public List<BlackList> SelectBlackList() {
        String sql = "SELECT userid FROM ad_blacklist";
        List<BlackList> query = template.query(sql, new BeanPropertyRowMapper<BlackList>(BlackList.class));
        return query;
    }
}
